package com.jeespring.admin.controller;

import com.jeespring.admin.service.ResourceService;
import com.jeespring.common.pojo.TreeNode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @title:
 * @description:
 * @author: 张朝阳
 * @date: 2019/5/1 00:00
 */
@Controller
@RequestMapping("/")
public class IndexController {
    @Autowired
    private ResourceService resourceService;

    @RequestMapping({"","/","index"})
    public String index(Model model){
        List<TreeNode> menuList = resourceService.getMenuList();
        model.addAttribute("menuList",menuList);
        return "index";
    }

    @RequestMapping("/content")
    public String content(Model model){
        return "common/content";
    }

    @RequestMapping("/login")
    public String login(Model model){
        return "login";
    }
}
